import { ComponentProps, VueComponent } from "vue3-oop"
import { FormData,WidgetNode } from '../../types'
import { DynamicWidget } from '../index'

interface IProps {
  formData: FormData,
  widgetNode: WidgetNode
}
export default class WidgetDraft extends VueComponent<IProps> {
  static defaultProps: ComponentProps<IProps> = {
    formData: {},
    widgetNode:{}
  }

  constructor(
  ){
    super();
  }

  render() {
    const { formData,widgetNode } = this.props;
    const props = { formData, widgetNode };
    // TODO
    return DynamicWidget[widgetNode.widgetType]?.DRAFT?h(DynamicWidget[widgetNode.widgetType].DRAFT(),props):null;
  }
}